<?php
function countTotalNumberOfCommunication($friends){
    $nOneWay = $nTwoWay = $nTotal = 0;
    
    foreach ($friends as $friend) {
        
        $nOneWay += $friend->getOneway();
        $nTwoWay += $friend->getTwoway();
        
    }
    $nTotal = $nOneWay + $nTwoWay;
    
    print("<br/>");
    print("Oneway : ".$nOneWay);
    print(" | Twoway : ".$nTwoWay);
    print(" | Total : ".$nTotal);
    
}

function func1($friends){
    $nOneWay = $nTwoWay = $nTotal = 0;
    
    foreach ($friends as $friend) {
        
        $nOneWay += $friend->getOneway();
        $nTwoWay += $friend->getTwoway();
        
    }
    $nTotal = $nOneWay + $nTwoWay;
    
    return $nTotal;
}